<?
session_start();
include('config.php');
//include('header.php');
require_once('classes/class.jira.php');
include("classes/connect.php");
ini_set('display_errors', 'Off');

if(!isset($_SESSION["Juname"])){
	 
	echo '<meta http-equiv="refresh" content="300;url=index.php">';
}

function getuser($username,$pass,$project,$host){
		$config->username= $username;
		$config->password= $pass;
		$config->port= "";
		$config->host= $host;
		$query->project = $project;

		$queryIssue = new Jira($config);
		$array=$queryIssue->queryUser($query);
		$response = json_decode($array->responseBody);
		return $response;
		}

                $arr_out[]= array();
                $user=getuser($username,$pass,$project,$host);
		foreach($user as $key){
                    $arr=  array(
                        'ass'=>$key->name
                    );
                    //echo $key->name;
                    $arr_out[]=$arr;
                }	
                
                echo json_encode($arr_out);
				
?>